import picklewrapper as pwr
FNAME = 'test.dat'
x = 100
pwr.save(FNAME, 'x')
del x #delete x from current stack


def outside_load_ex():
    #load x variable into this stackframe
    d = pwr.load(FNAME)
    print d
    #attempt to print x (should be loaded at this point)
    print "from outside_load_ex: ", x
    assert(x==100)

class A(object):
    def load_ex(self):
        #load x variable into this stackframe
        pwr.load(FNAME)
        #attempt to print x (should be loaded at this point)
        print "from A.load_ex: ", x

#TODO
outside_load_ex() #this does NOT works
myA = A()
myA.load_ex()     #this does NOT work

